﻿Imports Microsoft.VisualBasic

    'Clase abstracta
Public MustInherit Class Baraja

    Protected Const REVERSO As String = "reverso"
    Protected mazo As Mazo

    Protected idACarta As New Hashtable()
    'Protected iconos As New Hashtable()


    Protected Sub New()
        mazo = New Mazo(Me)
        'REVERSO = reversoBaraja
    End Sub

    Public Function generaMazo() As Mazo
        Return New Mazo(mazo)
    End Function

    Public Function cartaParaId(ByVal id As String) As Carta
        Return idACarta(id)
    End Function

    'Public Function imagenParaCarta(ByVal c As Carta) As Image
    '    Return iconos(c)
    'End Function

    'Public Function imagenReverso() As Image
    '    Return iconos(REVERSO)
    'End Function
    Public Class Singleton
        Private Shared mInstance As Singleton

        ' Private Constructor
        Private Sub New()
            MsgBox("New Singleton Object")
        End Sub

        Public Shared Function GetInstance() As Singleton
            If mInstance Is Nothing Then
                mInstance = New Singleton()
            End If

            Return mInstance
        End Function
    End Class



End Class

'Public Class Singleton


'    'Instancia única de la clase.
'    Private Shared _instancia As New Singleton()

'    'Constructor privado, para impedir que se instancie directamente.
'    Private Sub New()
'    End Sub

'    'Método de clase para acceder a la instancia única.
'    Public Shared Function GetInstance() As Singleton
'        Return _instancia
'    End Function

'End Class
